#include<cstdio>
#include<cstdlib>
#include<algorithm>
using namespace std;
struct link
{
	int data;
	link *next;
};
link *head,*tail;
int n,k,p,a[100000],tt=-1;
void CreateList(link *&s1,link *&r,int n)
{
	link *s;
	s1=new link;
	r=s1;
	for(int i=1;i<=n;i++)
	{
		s=new link;
		s->data=i;
		r->next=s;
		r=s;
	}
	s1=s1->next;
	r->next=s1;
}
void work()
{
	link *current=head,*pre=tail;
	int count=0;
	while(k>0)
	{
		int t=current->data;
		k--;
		count++;
		pre->next=current->next;
		current=current->next;
		if(count%n==0)a[++tt]=t;
		for(int i=1;i<=p;i++)
		{
			current=current->next;
			pre=pre->next;
		}
	}
}
int main()
{
	scanf("%d%d%d",&n,&k,&p);
	CreateList(head,tail,k);
	work();
	sort(a,a+tt+1);
	for(int i=0;i<=tt;i++)
		printf("%d\n",a[i]);
	return 0;
}

